package com.vhall.component.plugin.common.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
 * 日志链路追踪配置
 *
 * @author zlt
 * @date 2019/8/13
 */
@Data
@RefreshScope
@ConfigurationProperties(prefix = "vhall.log.req")
public class ReqLogProperties {
    /**
     * 是否开启请求响应日志日志
     */
    private Boolean enabled = false;
    private Header header;
    private Rsp rsp;


    public static class Header {
        /**
         * 是否开启头部信息 日志
         */
        private Boolean enabled = false;
        /**
         * 头部信息指定组
         */
        private String keys = "all";

        public Boolean getEnabled() {
            return enabled;
        }

        public void setEnabled(Boolean enabled) {
            this.enabled = enabled;
        }

        public String getKeys() {
            return keys;
        }

        public void setKeys(String keys) {
            this.keys = keys;
        }
    }

    public static class Rsp {
        /**
         * 是否开启 响应信息 日志
         */
        private Boolean enabled = false;
        /**
         * 响应信息日志 打印格式,simple|normal
         */
        private String logType = "simple";

        public Boolean getEnabled() {
            return enabled;
        }

        public void setEnabled(Boolean enabled) {
            this.enabled = enabled;
        }

        public String getLogType() {
            return logType;
        }

        public void setLogType(String logType) {
            this.logType = logType;
        }
    }
}
